﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SuperListEx
{
    public class NonGroupRow : RowIdentifier
    {
        #region Properties
        public override List<object> GroupValues
        {
            get;
            protected set;
        }

        public override List<Column> GroupColumns
        {
            get;
            protected set;
        }

        public override List<object> Items
        {
            get;
            protected set;
        }

        public override int ItemCount
        {
            get { return Items.Count; }
        }
        #endregion

        #region Constructors
        public NonGroupRow(object item)
        {
            GroupValues = new List<object>();
            GroupColumns = new List<Column>();
            Items = new List<object>();
            Items.Add(item);
        }
        #endregion        

        #region Object Overrides
        public override bool Equals(object obj)
        {
            if (ReferenceEquals(this, obj))
            {
                return true;
            }

            NonGroupRow other = obj as NonGroupRow;
            if (ReferenceEquals(other, null))
            {
                return false;
            }

            return other.Items[0] == Items[0];
        }

        public override int GetHashCode()
        {
            return Items[0].GetHashCode();
        }
        #endregion
    }
}
